<div class="portlet light bordered">
	<div class="portlet-title">
		<div class="caption font-dark">
			<i class="fa fa-cog font-dark"></i>
			<span class="caption-subject bold">编辑信息</span>
		</div>
	</div>
	<div class="portlet-body form">
		<form role="form" action="/definePage/edit" class="form-horizontal" method="post">
			<div class="form-body">
				<div class="form-group">
					<label class="control-label col-md-2">页面名称：</label>
					<div class="col-md-2">
						<input type="text" class="form-control" name="name" value="$!item.name" maxlength="32">
						<input type="hidden" class="form-control" name="id" value="$!item.id">
						<input type="hidden" class="form-control" name="quotes" value="$!item.quotes">
						<input type="hidden" class="form-control" name="views" value="$!item.views">
						<input type="hidden" class="form-control" name="createTime" value="$!item.createTime">
					</div>
				</div>
				
				<div class="form-group">
					<label class="control-label col-md-2">页面类型：</label>
					<div class="col-md-2" style="vertical-align: middle; margin-top: 7px;">
						<input type="radio" name="types" value="2" #if($!item.types=='2') checked #end >
						移动端
						<input type="radio" name="types" value="1" #if($!item.types=='1') checked #end >
						PC端
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-md-2">所属模板：</label>
					<div class="col-md-2" style="vertical-align: middle; margin-top: 7px;">
						 <select name="templateId" class="form-control bs-select templateName"  data-size="8" >
	                    	<option value="">请选择</option>
	                    	#foreach($template in $!templates)
		                    	<option value="$!template.id" #if($!item.templateId==$!template.id) selected #end>$!template.name</option>
	                        #end
	                    </select>
	                    <input type="hidden" id="templateName" name="templateName" value="$!item.templateName">
					</div>
					<script type="text/javascript">
						$("form").on("change",".templateName",function(){
							var templateName = $(this).find("option:selected").text()
							$("#templateName").val(templateName);
						})
					</script>
				</div>
				
				<div class="form-group">
					<label class="control-label col-md-2">页面标题：</label>
					<div class="col-md-3">
						<input type="text" class="form-control" name="title" value="$!item.title">
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-md-2">页面简介：</label>
					<div class="col-md-5">
						<textarea class="form-control" name="synopsis">$!item.synopsis</textarea>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-md-2">页面内容：</label>
					<div class="col-md-10">
						<textarea class="form-control" name="content" id="textContent" style="width: 100%; height: 400px;">$!item.content</textarea>
					</div>
				</div>

			</div>
			<div class="form-actions right">
				<a href="javascript:;" thref="/definePage/list" class="btn green ajax-post">
					<i class="fa fa-check"></i>
					提交
				</a>
				<a href="/definePage/list" class="btn btn-outline grey-salsa ajaxify">返回</a>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
$(function() {
	
	ComponentsSelect2.init() ;
	
	//kindeditor.js
/* 	KindEditor.ready(function(K) {
		var editor1 = K.create('textarea[id="textContent"]', {
			
			items: [  'source', '|', 'undo', 'redo', '|', 'preview', 'template', '|', 'justifyleft', 'justifycenter', 'justifyright',
		                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
		                'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
		                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
		                'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
		                'table', 'hr', 'emoticons', 'pagebreak',
		                'link', 'unlink', '|', 'about'
		            ],
		
		    filterMode: false,//是否开启过滤模式
	         k.fullPage :true,
			cssPath : '/kindeditor/plugins/code/prettify.css',
			uploadJson : '/upload-json.do',
			//fileManagerJson : '../jsp/file_manager_json.jsp',
			allowFileManager : false,
			//allowImageRemote : false,//设置为不能上传网络图片
			afterBlur: function () { this.sync(); }
		});
		//prettyPrint();
	}); */
	
})
</script>
